<nav class="navbar navbar-default navbar-fixed-top">
	<div class="container">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="" style="font-size: 25px; color: #337ab7;">旅游</a>
		</div>
		<div id="navbar" class="navbar-collapse collapse navbar-left">
			<ul class="nav navbar-nav">
				<li class="active"><a href="index.php">首页</a></li>
				<li><a href="main.php">在线导游</a></li>
				<li><a href="picture.php">景点介绍</a></li>
				<li><a href="chat.php">在线交流</a></li>
				<li class="dropdown onhover-dropdown">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
						关于我们
						<span class="caret"></span>
					</a>
					<ul class="dropdown-menu">
						<li><a href="faq.php">F.A.Q</a></li>
						<li><a href="reportbug.php">报告BUG</a></li>
						<li role="separator" class="divider"></li>
						<li><a href="running.php">开发历程</a></li>
					</ul>
				</li>
			</ul>
		</div>
		<div class="nav navbar-nav navbar-right"> <!--hidden-xs 在小型设备上隐藏-->
			<?php
				if (isset($_COOKIE["user"])) {
					$user = $_COOKIE["user"];
			?>
			<input id="user" style="display: none;" value="<?php echo $user; ?>"></label>
			<li class="dropdown onhover-dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
					<img id="nav_user_avatar" width="36" height="36" src="./img/userlogo.jpg">
					<?php
						echo $user;
					?>
					<span class="caret"></span>
				</a>
				<ul class="dropdown-menu">
					<li><a href="profile.php">我的账户</a></li>
					<li><a href="" onclick="return ajax_logout();">注销</a></li>
			    </ul>
			</li>
			<?php
				} else {
			?>
			<a href="#" onclick="return pop_Regisger();" style="text-decoration: none;">
				<button type="button" class="btn btn-default navbar-btn">注册</button>
			</a>
			<a href="#" onclick="return pop_Login();">
				<button type="button" class="btn btn-primary navbar-btn">登陆</button>
			</a>	
			<?php	
				}
			?>
		</div>
		<!--/.nav-collapse -->
	</div>
</nav>
<!--login-modal-dialog-->
<div class="modal fade" id="login_modal-dialog" aria-hidden="true" style="display: none;">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title">登陆</h4>
			</div>
			<form id="modal_login_form" role="form" method="post" action="logincheck.php" onsubmit="return ajax_login()">				
				<div class="modal-body">
					<div class="form-group">
						<label class="control-label"></label>
						<input type="text" class="form-control" name="username" placeholder="用户名">
					</div>
					<div class="form-group">
						<label class="control-label"></label>
						<input type="password" class="form-control" name="password" placeholder="密码">
					</div>
					<div class="form-group">
						<label class="control-label">记住我:</label>
						<select class="form-control" name="session_expiry">
							<option value="18000">5小时</option>
							<option value="172800">2天</option>
							<option value="1209600">2周</option>
							<option value="5356800">2个月</option>
						</select>
					</div>
				</div>
				<div class="modal-footer">
					<label class="errmsg haserr pull-left"></label>
					<button class="btn btn-default" type="button" data-dismiss="modal">取消</button>
					<button class="btn btn-primary" type="submit" value="mysubmit" >登陆</button>
				</div>
			</form>
		</div>
	</div>
</div>
	
<!--register-modal-dialog-->
<div class="modal fade in" id="register_modal-dialog" aria-hidden="true" style="display: none;">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title">注册</h4>
			</div>
			<form id="modal_register_form" role="form" method="post" action="registercheck.php">
				
				<div class="modal-body">
					<div class="form-group"><input type="text" class="form-control" name="username" placeholder="用户名"></div>
					<div class="form-group"><input type="email" class="form-control" name="email" placeholder="电子邮箱"></div>
					<div class="form-group"><input type="password" class="form-control" name="password" placeholder="密码"></div>
					<div class="form-group"><input type="password" class="form-control" name="password_rep" placeholder="重复密码"></div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="submit" class="btn btn-primary">注册</button>
				</div>
			</form>
		</div>
	</div>
</div>